import type { RouteRecordRaw } from 'vue-router'
import { monitor } from './monitor'
import { tour } from './oam/tour'
import { base } from './base'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/login',
    component: () => import('~/layout/loginLayout'),
    children: [
      {
        name: 'login',
        path: '/login',
        component: () => import('~/pages/login')
      }
    ]
  },
  {
    path: '/',
    component: () => import('~/layout/baseLayout'),
    children: [
      //  基站资产
      {
        name: 'basestation',
        path: '/basestation',
        children: [...base]
      },
      {
        name: 'home',
        path: 'home',
        // component: () => import('~/pages/home')
        component: () => import('~/pages/assetManagement/assetHome')
      },
      // 系统管理
      {
        name: 'system',
        path: '/system',
        redirect: '/system/application',
        component: () => import('~/components/PageLoading'),
        children: [
          // 子系统管理
          {
            name: 'system_application',
            path: '/system/application',
            component: () => import('~/pages/system/application')
          },
          // 用户管理
          {
            name: 'system_user',
            path: '/system/user',
            component: () => import('~/pages/system/systemUser')
          },
          // 部门管理
          {
            name: 'system_dept',
            path: '/system/dept',
            component: () => import('~/pages/system/systemDept')
          },
          // 角色管理
          {
            name: 'system_role',
            path: '/system/role',
            component: () => import('~/pages/system/systemRole')
          },
          // 菜单管理
          // {
          //   name: 'system_menu',
          //   path: '/system/menu',
          //   component: () => import('~/pages/system/systemMenu')
          // },
          // 岗位管理
          {
            name: 'system_post',
            path: '/system/post',
            component: () => import('~/pages/system/systemPost')
          },
          // 参数管理
          {
            name: 'system_param',
            path: '/system/param',
            component: () => import('~/pages/system/systemParam')
          },
          // 字典管理
          // {
          //   name: 'system_dict',
          //   path: '/system/dict',
          //   component: () => import('~/pages/system/systemDict')
          // },
          // 应用管理
          {
            name: 'system_client',
            path: '/system/client',
            component: () => import('~/pages/system/systemClient')
          },
          // 系统通告
          {
            name: 'system_notice',
            path: '/system/notice/notice',
            component: () => import('~/pages/system/notice')
          },
          // 个人消息
          {
            name: 'system_message',
            path: '/system/message/message',
            component: () => import('~/pages/system/message')
          },
          // 消息模板
          {
            name: 'system_template',
            path: '/system/template/template',
            component: () => import('~/pages/system/template')
          },
          // 意见反馈
          {
            name: 'system_Advice',
            path: '/system/Advice/Advice',
            component: () => import('~/pages/system/advice')
          },
          // 字典管理
          {
            name: 'system_dict',
            path: '/system/dict',
            component: () => import('~/pages/system/dict')
          }
        ]
      },
      // 异常页
      {
        path: '404',
        name: '404',
        component: () => import('~/pages/exception/404')
      },
      // 运维管理
      {
        name: 'oam',
        path: '/oam',
        redirect: '/oam/opeHomepage',
        component: () => import('~/components/PageLoading'),
        children: [
          // 运维首页
          {
            name: 'oam_opeHomepage',
            path: '/oam/opeHomepage',
            component: () => import('~/pages/oam/opeHomepage')
          },
          // 我的待办
          {
            name: 'oam_toDo',
            path: '/oam/toDo',
            component: () => import('~/pages/oam/toDo')
          },
          // 工单管理
          {
            name: 'oam_orderMan',
            path: '/oam/orderMan',
            redirect: '/oam/orderManage',
            component: () => import('~/components/PageLoading'),
            children: [
              // 工单列表
              {
                name: 'produce_order_order',
                path: '/oam/orderManage',
                component: () => import('~/pages/oam/orderManage')
              },
              // 工单列表-新增、编辑
              {
                name: 'produce_order_order_ordersUpdate',
                path: '/oam/orderManage/ordersUpdate',
                component: () => import('~/pages/oam/orderManage/OrdersUpdate')
              },
              // 工单列表-详情
              {
                name: 'produce_order_order_options',
                path: '/oam/orderManage/options',
                component: () => import('~/pages/oam/orderManage/options')
              },
              // 工单统计
              {
                name: 'oam_orderStatistics',
                path: '/oam/orderStatistics',
                component: () => import('~/pages/oam/orderStatistics')
              },
              // 工单设置
              {
                name: 'oam_orderSet',
                path: '/oam/orderSet',
                component: () => import('~/pages/oam/orderSet')
              }
            ]
          },
          // 巡视管理
          {
            name: 'oam_tour',
            path: '/oam/tour',
            redirect: '/oam/tour/plan',
            children: [...tour]
          }
        ]
      },
      // 资产管理
      {
        name: 'asset_management',
        path: 'asset_management',
        component: () => import('~/components/PageLoading'),
        children: [
          // 资产首页
          {
            name: 'asset_home',
            path: '/asset_home',
            component: () => import('~/pages/assetManagement/assetHome')
          },
          // 设施管理
          {
            name: 'facility_management',
            path: 'facility_management',
            component: () => import('~/components/PageLoading'),
            children: [
              // 配电设施
              {
                name: 'power_distribution_facilities',
                path: 'power_distribution_facilities',
                component: () =>
                  import('~/pages/assetManagement/facilityManagement/powerDistributionFacilities')
              },
              // 灯
              {
                name: 'asset_lamp_base',
                path: '/asset_lamp_base',
                component: () => import('~/pages/assetManagement/facilityManagement/assetLampBase')
              },
              // 灯杆
              {
                name: 'asset_lamp_post',
                path: '/asset_lamp_post',
                component: () => import('~/pages/assetManagement/facilityManagement/assetLampPost')
              }
            ]
          },
          {
            // 区域管理
            name: 'asset_area_manage',
            path: 'asset_area_manage',
            component: () => import('~/components/PageLoading'),
            children: [
              // 工区管理
              {
                name: 'asset_work_area',
                path: 'asset_work_area',
                component: () => import('~/pages/assetManagement/assetAreaManage/assetWorkArea')
              },
              // 道路管理
              {
                name: 'assets_road_manage',
                path: '/assets_area_manage/assets_road_manage',
                component: () => import('~/pages/assetManagement/assetAreaManage/assetRoadManage')
              }
            ]
          },
          {
            // 资产总览
            name: 'asset_overview',
            path: '/asset_overview',
            component: () => import('~/pages/assetOverview')
          },
          //  回路监控箱
          {
            name: 'asset_hardware',
            path: '/asset_hardware',
            component: () => import('~/pages/asset/hardware')
          },
          //  单灯控制器
          {
            name: 'asset_lamp_control',
            path: '/asset_lampcontrol',
            component: () => import('~/pages/asset/lampcontrol')
          },
          //  智能井盖
          {
            name: 'asset_manhole',
            path: '/asset_manhole',
            component: () => import('~/pages/asset/manhole')
          }
        ]
      },
      // 监控管理
      {
        name: 'monitor_management',
        path: 'monitor_management',
        component: () => import('~/components/PageLoading'),
        children: [
          ...monitor
          // {
          //   name: 'loop_monitor_box',
          //   path: '/monitor/loop_monitor_box',
          //   component: () => import('~/components/PageLoading'),
          //   children: [
          //     // 回路开关分组
          //     {
          //       name: 'loop_switch_group',
          //       path: '/monitor/loop_monitor_box/loop_switch_group',
          //       redirect: '/monitor/loop_monitor_box/loop_switch_group',
          //       component: () => import('~/components/PageLoading'),
          //       children: [
          //         {
          //           name: 'loop_switch_group',
          //           path: '/monitor/loop_monitor_box/loop_switch_group',
          //           component: () =>
          //             import('~/pages/monitorManagement/loopMonitorBox/loopSwitchGroup')
          //         }
          //       ]
          //     },
          //     // 开关灯任务
          //     {
          //       name: 'switch_light_strategy',
          //       path: '/monitor/loop_monitor_box/switch_light_strategy',
          //       component: () =>
          //         import('~/pages/monitorManagement/loopMonitorBox/switchLightStrategy')
          //     }
          //   ]
          // }
        ]
      },
      //  监控管理
      {
        name: 'monitor',
        path: '/monitor',
        children: [...monitor]
      }
    ]
  }
]

export default routes
